import globalConfig from "@/utils/config.js";
import { request } from "@/utils/http.js";

const baseUrl = globalConfig.microUrl;
/**
 * 优惠券接口
 */
export default {
  // 商品分类-首页
  getSaleCoupons: (data) => {
    return request({
      url: `${baseUrl}/market/coupon/getSaleCoupons`,
      method: "POST",
      data
    }); // 订单确认页获取优惠券
  },
  getCouponGoodsPage: (data) => {
    return request({
      url: `${baseUrl}/market/coupon/couponGoodsPage`,
      method: "GET",
      data
    }); // 优惠券列表-去使用
  },
  getGoodsSkuList: (data) => {
    return request({
      url: `${baseUrl}/gd/goods/getGoodsSkuList`,
      method: "GET",
      data
    }); // 各类优惠券适用商品列表
  },
  // 优惠券列表
  couponList: (data) => {
    return request({
      url: `${baseUrl}/market/coupon/page`,
      method: "GET",
      data
    });
  },
  // 优惠券列表统计
  getCouponCount: (data) => {
    return request({
      url: `${baseUrl}/market/coupon/listCount`,
      method: "GET",
      data
    });
  }
};
